<template>
  <!-- 顶部 -->
  <topNav />
  <!-- 头部导航 -->
  <appHeader />
  <!-- 吸顶 -->
  <appHeaderSticky />
  <main>
    <!-- 二级路由 -->
    <router-view></router-view>
  </main>
  <appFooter />
</template>

<script>
// 导入组件
import topNav from '@/components/app-topnav.vue'
import appHeader from '@/components/app-header.vue'
import appFooter from '@/components/app-footer.vue'
import appHeaderSticky from '@/components/app-header-sticky.vue'
// 导入 vuex的 辅助函数
import { useStore } from 'vuex'

// 布局容器
export default {
  name: 'xtx-layout',
  components: {
    topNav,
    appHeader,
    appFooter,
    appHeaderSticky
  },
  setup () {
    const store = useStore()
    // 触发 action
    store.dispatch('category/getCateList')
  }
}
</script>

<style scoped lang="less"></style>
